<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>企业用户_用户管理_添加用户</title>
		<link rel="stylesheet" type="text/css" href="css/common.css" />
		<link rel="stylesheet" type="text/css" href="css/icon.css" />
		<script src="js/jquery-1.8.2.min.js"/></script> 
		<!--<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap.css" />-->
		<!--<link rel="stylesheet" type="text/css" href="css/bootstrap/bootstrap.min.css" />-->
		<!--<script src="js/bootstapPage/bootstrap.min.js"></script>-->
		<!--<script src="js/bootstapPage/bootstrap.js"></script>-->
		<style>
			body { background: #Fff; }			
			.overlay,
			.overlay select,
			.overlay .form-dropdown { width: 142px; }			
			.form>form>div label { width: 85px; text-align: right; display: inline-block; }
			.form>form>div label.error { width: auto; }
			.form>form>div input {height:30px;}
		</style>
	</head>

	<body>
		<div class="form" style="padding:30px;">
			<input type="hidden" value="" class="productId" />
			<form class="block-form" id="commentForm">
				<div style="margin-top:0px;">
					<label><span class="red">*</span>姓名：</label>
					<input type="text" class="user_name" placeholder="请输入姓名" name="user_name" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red">*</span>账号：</label>
					<input type="text" class="user_account" placeholder="请输入账号" name="user_account" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red">*</span>密码：</label>
					<input type="password" class="user_password" placeholder="请输入密码" name="user_password" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red">*</span>确认密码：</label>
					<input type="password" class="user_password2nd" placeholder="请确认密码" name="user_password2nd" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red">*</span>手机：</label>
					<input type="tel" class="user_phone" placeholder="请输入手机号码" name="user_phone" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red hidden">*</span>座机：</label>
					<input type="tel" class="user_telphone" placeholder="请输入座机号码" name="user_telphone" />
				</div>
				<div style="margin-top:25px;">
					<label><span class="red">*</span>邮箱：</label>
					<input type="email" class="user_email" placeholder="请输入邮箱账号" name="user_email" />
				</div>
				

				<div style="margin-top:20px;">
					<label><span class="red">*</span>所属企业：</label>
					<div class="overlay">
						<!--这个是用来存放选中的select的值的-->
						<input type="hidden" value="" class="form-select-value companyValue"  />
						<div class="dropdown">
							<button class="dropdown-toggle form-dropdown" type="button">
				                    <span class="value text-ellipsis pro_catevalue">请选择</span>
				                    <span class="caret"></span>
				            </button>
							<ul class="none">
								<li data-value='001'>待定</li>
								<li data-value='002'>待定2</li>
								<li data-value='003'>待定3</li>
								<li data-value='004'>依旧待定</li>
							</ul>
						</div>
					</div>
					<input type="text" value="" class="form-select-value"  name="user_company" style="visibility: hidden; width:0px;" />
				</div>

				<div style="">
					<label><span class="red">*</span>用户角色：</label>
					<div class="overlay">
						<!--这个是用来存放选中的select的值的-->
						<input type="hidden" value="" class="form-select-value roleValue"  />
						<div class="dropdown">
							<button class="dropdown-toggle form-dropdown" type="button">
				                    <span class="value text-ellipsis pro_catevalue">请选择</span>
				                    <span class="caret"></span>
				            </button>
							<ul class="none">
								<li data-value='001'>待定</li>
								<li data-value='002'>待定2</li>
								<li data-value='003'>待定3</li>
								<li data-value='004'>依旧待定</li>
							</ul>
						</div>
					</div>
					<input type="text" value="" class="form-select-value" name="user_role" style="visibility: hidden; width:0px;" />
				</div>
				
				<div style="">
					<label><span class="red">*</span>用户类型：</label>
					<div class="overlay">
						<!--这个是用来存放选中的select的值的-->
						<input type="hidden" value="" class="form-select-value typeValue"  />
						<div class="dropdown">
							<button class="dropdown-toggle form-dropdown" type="button">
				                    <span class="value text-ellipsis pro_catevalue">请选择</span>
				                    <span class="caret"></span>
				            </button>
							<ul class="none">
								<li data-value='001'>待定</li>
								<li data-value='002'>待定2</li>
								<li data-value='003'>待定3</li>
								<li data-value='004'>依旧待定</li>
							</ul>
						</div>
					</div>
					<input type="text" value="" class="form-select-value" name="user_type" style="visibility: hidden; width:0px;" />
				</div>
				

				<div>
					<label><span class="red hidden">*</span>备注：</label>
					<textarea placeholder="选填，不超过200字符" style="width:350px;height:100px;vertical-align: top;" class="pro_desc" name="desc"></textarea>
				</div>

				<div style="margin-top:20px;margin-left:150px;">
					<input type="submit" value="保存" class="search-input-button bgblue" id="subButton" />
					<input type="button" value="返回" class="search-input-button " id="backButton" style="margin-left: 80px;" />
				</div>
			</form>
		</div>

		<script src="js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/js.js" type="text/javascript" charset="utf-8"></script>
		<!--<script src="js/wdatePicker/WdatePicker.js" type="text/javascript" charset="utf-8"></script>-->
		<script src="js/jquery.cxselect.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/scroll/jquery.slimscroll.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/messages_zh.min.js" type="text/javascript" charset="utf-8"></script>
		<script>
			$.validator.setDefaults({
			submitHandler: function() {
				//这里放验证成功之后要执行的函数
				
			}
		});
			
			$.validator.addMethod("isCompanyEmpty", function(value, element) {
			if($('.companyValue').val()){
				return true;
			}else{return false;}
		}, "<i class=\" icon icon_error_red \"></i>请选择所属企业！");
		    $.validator.addMethod("isRoleEmpty", function(value, element) {
			if($('.roleValue').val()){
				return true;
			}else{return false;}
		}, "<i class=\" icon icon_error_red \"></i>请选择用户角色！");
		    $.validator.addMethod("isTypeEmpty", function(value, element) {
			if($('.typeValue').val()){
				return true;
			}else{return false;}
		}, "<i class=\" icon icon_error_red \"></i>请选择用户类型！");
		
	$(document).ready(function() {
			$("#commentForm").validate({
				rules: {
					user_name: {
						required: true,
					},
					user_account: {
						required: true,
					},
					user_password: {
						required: true,
					},
					user_password2nd: {
						required: true,
					},
					user_phone: {
						required: true,
					},
					user_email: {
						required: true,
					},
								
//					修改
					user_company: {
						isCompanyEmpty: true,
					},
					user_role: {
						isRoleEmpty: true,
					},
					user_type: {
						isTypeEmpty: true,
					},

				},
				messages: {
					user_name: {
						required: "<i class=\" icon icon_error_red \"></i>请输入姓名",
					},
					
					user_account: {
						required: "<i class=\" icon icon_error_red \"></i>请输入账号",
					},
					user_password: {
						required: "<i class=\" icon icon_error_red \"></i>请输入密码",
					},
					user_password2nd: {
						required: "<i class=\" icon icon_error_red \"></i>请输入确认密码",
					},
					user_phone: {
						required: "<i class=\" icon icon_error_red \"></i>请输入手机号码",
					},
					user_email: {
						required: "<i class=\" icon icon_error_red \"></i>请输入邮箱账号",
					},
					
				},
				
				errorPlacement: function(error, element) {
					error.appendTo('<i class=\" icon icon_error_red \"></i>').appendTo(element.parent());
				},
			});
		});
		
		
		$(function() {
				productObj.staticPath='js/cityData.min.json'
				productObj.productInit();
                //productObj.getProData();
			});
		</script>

	</body>

</html>